package com.vladimirkolarevic.eventplanner.beans;

import java.io.Serializable;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToOne;
import javax.persistence.PrimaryKeyJoinColumn;

import com.vladimirkolarevic.eventplanner.City;
import com.vladimirkolarevic.eventplanner.Location;
@Entity
public class LocationBean implements Location,Serializable {
	@Id
	@GeneratedValue
	private Long id;
	
	@OneToOne(targetEntity=CityBean.class,cascade=CascadeType.ALL)
	@PrimaryKeyJoinColumn
	private City city;
	
	public LocationBean() {
		// TODO Auto-generated constructor stub
	}
	

	public City getCity() {
		// TODO Auto-generated method stub
		return city;
	}

	
	public Long getId() {
		// TODO Auto-generated method stub
		return id;
	}

	
	public void setCity(City city) {
		// TODO Auto-generated method stub
		this.city=city;
	}

	
	
}
